
package com.bk.model;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Order {
	/**
	 *   `oid` varchar(32) NOT NULL,
  `ordertime` datetime DEFAULT NULL,
  `total` double DEFAULT NULL,
  `state` int(11) DEFAULT NULL,
  `address` varchar(30) DEFAULT NULL,
  `name` varchar(20) DEFAULT NULL,
  `telephone` varchar(20) DEFAULT NULL,
  `uid` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`oid`)
	 */
	
	private String oid;
	private Date ordertime;
	private double total;
	private int state;// 0表示未支付  1表示已支付成功 2定在正发送中   3订单完成   ....
	private String address;
	private String name;
	private String telephone;
	private User user;
	
	/**
	 * 订单项
	 */
	private List<OrderItem> orderitems=new ArrayList<OrderItem>();
	
	
	public List<OrderItem> getOrderitems() {
	
		return orderitems;
	}
	public void setOrderitems(List<OrderItem> orderitems) {
	
		this.orderitems = orderitems;
	}
	public String getOid() {
	
		return oid;
	}
	public void setOid(String oid) {
	
		this.oid = oid;
	}
	public Date getOrdertime() {
	
		return ordertime;
	}
	public void setOrdertime(Date ordertime) {
	
		this.ordertime = ordertime;
	}
	public double getTotal() {
	
		return total;
	}
	public void setTotal(double total) {
	
		this.total = total;
	}
	public int getState() {
	
		return state;
	}
	public void setState(int state) {
	
		this.state = state;
	}
	public String getAddress() {
	
		return address;
	}
	public void setAddress(String address) {
	
		this.address = address;
	}
	public String getName() {
	
		return name;
	}
	public void setName(String name) {
	
		this.name = name;
	}
	public String getTelephone() {
	
		return telephone;
	}
	public void setTelephone(String telephone) {
	
		this.telephone = telephone;
	}
	public User getUser() {
	
		return user;
	}
	public void setUser(User user) {
	
		this.user = user;
	}
	
	public Order(String oid, Date ordertime, double total, int state, String address, String name, String telephone,
			User user, List<OrderItem> orderitems) {
		super();
		this.oid = oid;
		this.ordertime = ordertime;
		this.total = total;
		this.state = state;
		this.address = address;
		this.name = name;
		this.telephone = telephone;
		this.user = user;
		this.orderitems = orderitems;
	}
	@Override
	public String toString() {
		return "Order [oid=" + oid + ", ordertime=" + ordertime + ", total=" + total + ", state=" + state + ", address="
				+ address + ", name=" + name + ", telephone=" + telephone + ", user=" + user + ", orderitems="
				+ orderitems + "]";
	}
	public Order() {
		
		super();
		//TODO 
			
	}
	
	
	

}

	